// 版权所有2009 Go作者。版权所有。
// 此源代码的使用受BSD样式
// 许可证的约束，该许可证可以在许可证文件中找到。

// 调试参数，由-d标志设置。

package base

// Debug保存解析的调试配置值。
var Debug DebugFlags

// DebugFlags定义调试配置值（请参阅var Debug）。
// 每个结构字段都是一个不同的值，以字段名的小写字母命名。
// 每个字段必须是int或string，并且必须有一个'help'结构标记。
// 
// d选项采用逗号分隔的设置列表。
// 每个设置都是name=value；对于int，name是name=1的缩写。
type DebugFlags struct {
	Append               int    `help:"print information about append compilation"`
	Checkptr             int    `help:"instrument unsafe pointer conversions\n0: instrumentation disabled\n1: conversions involving unsafe.Pointer are instrumented\n2: conversions to unsafe.Pointer force heap allocation"`
	Closure              int    `help:"print information about closure compilation"`
	DclStack             int    `help:"run internal dclstack check"`
	Defer                int    `help:"print information about defer compilation"`
	DisableNil           int    `help:"disable nil checks"`
	DumpPtrs             int    `help:"show Node pointers values in dump output"`
	DwarfInl             int    `help:"print information about DWARF inlined function creation"`
	Export               int    `help:"print export data"`
	GCProg               int    `help:"print dump of GC programs"`
	InlFuncsWithClosures int    `help:"allow functions with closures to be inlined"`
	Libfuzzer            int    `help:"enable coverage instrumentation for libfuzzer"`
	LocationLists        int    `help:"print information about DWARF location list creation"`
	Nil                  int    `help:"print information about nil checks"`
	NoOpenDefer          int    `help:"disable open-coded defers"`
	PCTab                string `help:"print named pc-value table\nOne of: pctospadj, pctofile, pctoline, pctoinline, pctopcdata"`
	Panic                int    `help:"show all compiler panics"`
	Slice                int    `help:"print information about slice compilation"`
	SoftFloat            int    `help:"force compiler to emit soft-float code"`
	SyncFrames           int    `help:"how many writer stack frames to include at sync points in unified export data"`
	TypeAssert           int    `help:"print information about type assertion inlining"`
	TypecheckInl         int    `help:"eager typechecking of inline function bodies"`
	Unified              int    `help:"enable unified IR construction"`
	UnifiedQuirks        int    `help:"enable unified IR construction's quirks mode"`
	WB                   int    `help:"print information about write barriers"`
	ABIWrap              int    `help:"print information about ABI wrapper generation"`
	MayMoreStack         string `help:"call named function before all stack growth checks"`

	Any bool // 设置任何调试标志时设置
}

// 调用DebugSSA来设置a-d ssa/。。。选项
// 如果为零，这些选项将被报告为无效选项。
// 如果DebugSSA返回非空字符串，则该文本将报告为编译器错误。
var DebugSSA func(phase, flag string, val int, valString string) string
